﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using WRJClient.Common;

namespace WRJClient.Net
{
    public class AirlineMessageProcessor : IMessageProcessor
    {
        public void Process(TopicData topicData)
        {
            switch (topicData.eventId)
            {
                case 1://航线新建事件
                    AirlineAddProcess(topicData);
                    break;
                case 2://航线变更事件
                    AirlineUpdateProcess(topicData);
                    break;
                case 3://航线删除事件
                    AirlineDelProcess(topicData);
                    break;
                default:
                    MessageManager.Instance.Error(string.Format("未知航线主题[{0}]", topicData.eventId));
                    break;
            }
        }

        private void AirlineAddProcess(TopicData topicData)
        {
            MessageManager.Instance.Info(string.Format("新建航线[{0}]!", topicData.id));
        }
        private void AirlineUpdateProcess(TopicData topicData)
        {
            MessageManager.Instance.Info(string.Format("更新航线[{0}]!", topicData.id));
        }
        private void AirlineDelProcess(TopicData topicData)
        {
            MessageManager.Instance.Info(string.Format("删除航线[{0}]!", topicData.id));
        }
    }
}
